package com.example.edu.Mapper;

import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface User_PictureMapper {
    @Select("select count(*) from user_picture where picture_id = #{picture_id} and user_telephone = #{telephone}")
    int getRelationship(@Param("picture_id") int picture_id,@Param("telephone") String telephone);

    @Insert("insert into user_picture values (#{telephone} , #{picture_id})")
    void addRelationship(@Param("picture_id") int picture_id,@Param("telephone") String telephone);

    @Select("select count(*) from user_picture where user_telephone = #{telephone}")
    int getRelationshipNum(@Param("telephone") String telephone);

    @Delete("delete from user_picture where picture_id = #{picture_id} and user_telephone = #{telephone}")
    void deleteRelationship(@Param("picture_id") int picture_id,@Param("telephone") String telephone);
}
